package org.example.gc;

import java.util.ArrayList;
import java.util.List;

public class Test1 {
	private byte[] bs = new byte[1024*1024];
	
	public static void main(String[] args) {
		
		List<Test1> list = new ArrayList<Test1>();
		
		int num = 0;
		try {
			while(true) {
				list.add(new Test1());
				num++;
			}
		}catch(Throwable err) {
			System.out.println("now error , num=="+num);
			err.printStackTrace();
		}
		
		System.out.println("totalMemory==="+Runtime.getRuntime().totalMemory()/1024.0/1024.0);
		System.out.println("freeMemory==="+Runtime.getRuntime().freeMemory()/1024.0/1024.0);
		System.out.println("maxMemory==="+Runtime.getRuntime().maxMemory()/1024.0/1024.0);
	}
}
